﻿<Window x:Class="ThumbGen.DebugTemplateBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ThumbGen"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    SizeToContent="Manual" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Width="600" Height="530"
    AllowsTransparency="False" Background="Transparent" ShowInTaskbar="True" Title="Test template/Create manual sheet">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="Bool2VisibConverter"/>
        <sys:String x:Key="imgFilter">Image Files (JPEG,GIF,BMP,PNG)|*.jpg;*.jpeg;*.gif;*.bmp;*.png|JPEG Files(*.jpg;*.jpeg)|*.jpg;*.jpeg|GIF Files(*.gif)|*.gif|BMP Files(*.bmp)|*.bmp|PNG Files(*.png)|*.png</sys:String>
        <sys:String x:Key="metadataFilter">Metadata files (*.tgmd)|*.tgmd</sys:String>
        <DrawingBrush x:Key="DottedBrush" ViewportUnits="Absolute" Viewport="0,0,2,2" TileMode="Tile">
            <DrawingBrush.Drawing>
                <GeometryDrawing Brush="Gray" Geometry="M0,0 0,1 1,1 1,0Z M 1,1 2,1 2,2 1,2z"/>
            </DrawingBrush.Drawing>
        </DrawingBrush>
        <Style TargetType="{x:Type TabItem}"/>
        <Style TargetType="{x:Type TextBox}"/>
    </Window.Resources>
    <Border Padding="1" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="1" Background="White">
        <Border Padding="5" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="1" Background="White"
                HorizontalAlignment="Stretch">
            <Grid MinWidth="100" MinHeight="30">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <!--<local:OptionsButton VerticalAlignment="Top" Width="23" Height="23" HorizontalAlignment="Right"/>-->
                <StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Stretch">

                    <TextBlock Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top" FontWeight="Bold" Text="Test your template or manually create a sheet" Margin="0 0 0 10"/>
                    <local:TemplateSelectorControl x:Name="TemplateSelector"  HorizontalAlignment="Left" ShowTvixieButton="True" LabelText="Select template: " Margin="10 3 0 3"/>

                    <local:FileSelectorControl x:Name="fsMovieFile" Filter="All files (*.*)|*.*" Width="500" HorizontalAlignment="Left" Label="Movie file/folder:" AllowFolder="True" Margin="10"/>
                    <TextBlock FontSize="9" Foreground="Blue" Text="The movie file is used to extract media info if it is missing from .nfo file" HorizontalAlignment="Center"/>
                    <TabControl x:Name="tabControl" Margin="0 5 0 0" SelectionChanged="tabControl_SelectionChanged" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
                        <TabItem x:Name="tabMetadata">
                            <TabItem.HeaderTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/images/metadata.gif" VerticalAlignment="Center" Width="16" Height="16" Stretch="Uniform"/>
                                        <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="Use metadata file"/>
                                    </StackPanel>
                                </DataTemplate>
                            </TabItem.HeaderTemplate>
                            <StackPanel Orientation="Vertical">
                                <local:FileSelectorControl x:Name="fsMetadata" Filter="{StaticResource metadataFilter}"  Width="500" HorizontalAlignment="Left" 
                                                           Label="Metadata file:" Margin="5"/>
                                <local:MetadataControl x:Name="MetadataControl" IsMain="True" Margin="0 10 0 0" IsToolbarVisible="False"/>
                            </StackPanel>
                        </TabItem>
                        <TabItem x:Name="tabCustom">
                            <TabItem.HeaderTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/images/manual.png" VerticalAlignment="Center" Width="16" Height="16" Stretch="Uniform"/>
                                        <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="Use custom data"/>
                                    </StackPanel>
                                </DataTemplate>
                            </TabItem.HeaderTemplate>
                            <StackPanel Orientation="Vertical">
                                <local:FileSelectorControl x:Name="fsNfo" Filter=".nfo files (*.nfo)|*.nfo|All files (*.*)|*.*" Width="500" HorizontalAlignment="Left" Label="Info file:" Margin="5"/>
                                <local:FileSelectorControl x:Name="fsBackdrop" Label="Background" Filter="{StaticResource imgFilter}" Width="500" HorizontalAlignment="Left" Margin="5"/>
                                <local:FileSelectorControl x:Name="fsCover" Label="Cover" Filter="{StaticResource imgFilter}"  Width="500" HorizontalAlignment="Left" Margin="5"/>
                                <local:FileSelectorControl x:Name="fsFanart1" Label="Fanart1" Filter="{StaticResource imgFilter}" Width="500" HorizontalAlignment="Left" Margin="5"/>
                                <local:FileSelectorControl x:Name="fsFanart2" Label="Fanart2" Filter="{StaticResource imgFilter}"  Width="500" HorizontalAlignment="Left" Margin="5"/>
                                <local:FileSelectorControl x:Name="fsFanart3" Label="Fanart3" Filter="{StaticResource imgFilter}"  Width="500" HorizontalAlignment="Left" Margin="5"/>
                            </StackPanel>
                        </TabItem>
                        <TabItem x:Name="tabXML" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
                            <TabItem.HeaderTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <!--<Image Source="/images/file.png" VerticalAlignment="Center"/>-->
                                        <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="Rendered XML (debug)"/>
                                    </StackPanel>
                                </DataTemplate>
                            </TabItem.HeaderTemplate>
                            <ScrollViewer Height="250" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                <TextBox x:Name="Debug" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="False"/>
                            </ScrollViewer>
                        </TabItem>
                        <TabItem x:Name="tabInfo" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
                            <TabItem.HeaderTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/images/movie.png" VerticalAlignment="Center"/>
                                        <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="Generate a .nfo file"/>
                                    </StackPanel>
                                </DataTemplate>
                            </TabItem.HeaderTemplate>
                            <ScrollViewer Height="250" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                <local:MovieInfoControl IsFullEditor="False" x:Name="TheMovieInfoControl"/>
                            </ScrollViewer>
                        </TabItem>
                    </TabControl>
                </StackPanel>

                <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="10" HorizontalAlignment="Center">
                    <Button x:Name="OkButton" ToolTip="Use the selected template" FontWeight="Bold"
                            MinWidth="75" Margin="3" IsDefault="False" Click="OkButton_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/images/view.png" VerticalAlignment="Center" Width="16" Height="16"/>
                            <TextBlock Text="Preview" VerticalAlignment="Center" Margin="2 0 0 0"/>
                        </StackPanel>
                    </Button>

                    <Button x:Name="SaveOriginalImageButton" Margin="2" VerticalAlignment="Center" Click="SaveOriginalImageButton_Click" ToolTip="Save moviesheet to disk" MinWidth="75">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/images/save.png" VerticalAlignment="Center" Width="16" Height="16"/>
                            <TextBlock Text="Save..." VerticalAlignment="Center" Margin="2 0 0 0"/>
                        </StackPanel>
                    </Button>

                    <Button x:Name="GenerateMetadataButton" Margin="2" VerticalAlignment="Center" Click="GenerateMetadataButton_Click" ToolTip="Generate metadata file" MinWidth="75">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/images/metadata.gif" VerticalAlignment="Center" Width="16" Height="16"/>
                            <TextBlock Text="Create metadata..." VerticalAlignment="Center" Margin="2 0 0 0"/>
                        </StackPanel>
                    </Button>

                    <Button x:Name="GenerateNfoFile" Margin="2" MinWidth="75" VerticalAlignment="Center" Click="GenerateNfoFile_Click" 
                            ToolTip="Generate a custom .nfo file">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                            <Image Source="/Images/movie.png" VerticalAlignment="Center"/>
                            <TextBlock Text="Generate .nfo file..." Margin="2 0 0 0" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>

                    <Button x:Name="Missing" 
                            Content="Cancel" MinWidth="75" Margin="3" Click="Missing_Click" />
                </StackPanel>
            </Grid>
        </Border>
    </Border>

</Window>